home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / debuging.arc / NMI.DOC < prev    next >
Text File  |  1988-04-11  |  12KB  |  331 lines

  1.  
  2.  
  3.  
  4.                                 NMI  Version 1.03
  5.                                   by Dennis Lee
  6.  
  7.  
  8.              Have you ever seen the message 'PARITY CHECK' on your
  9.           display?  If you have, you've probably noticed that it
  10.           always seems to happen at the most inopportune time.  You're
  11.           cruising along putting the finishing touches on something
  12.           that you've worked long and hard, just to look up from the
  13.           keyboard to a blank display with only the words 'PARITY
  14.           CHECK' in the upper left corner.  Your heart sinks into your
  15.           shoes, your face gets flush, and palms begin to sweat, as
  16.           you try franticly to figure a way out of this one... but you
  17.           KNOW that you've lost everything!  Your only option is to
  18.           power off and start over.
  19.  
  20.              NMI is a resident program to replace the non-maskable
  21.           interrupt handler that the PC uses to handle parity errors.
  22.           In the event of a parity error, NMI will interrupt the
  23.           currently executing program(s) and begin testing memory,
  24.           looking for the error.  It will continue testing until
  25.           either it locates a failing address, or you interrupt it by
  26.           pressing a key.  If a failure is located, NMI will display
  27.           the failing 64K bank, exact memory address, and if possible,
  28.           the failing bit(s). You have the option to continue or
  29.           terminate testing.  If you interrupt the memory test, or
  30.           elect not to continue testing after an error is detected,
  31.           you are given the options to return to the interrupted
  32.           program(s) with or without parity checking enabled, or to
  33.           reboot the system.
  34.  
  35.              The memory test is of a nondestructive type, in that it
  36.           will preserve the current contents of memory.  It can be
  37.           executed any time without regard for concurrently executing
  38.           processes.  It's also a very thorough test, reading and
  39.           writing each byte of memory with several different bit
  40.           patterns and checking for parity errors following each read
  41.           or write operation.  Every memory location is tested,
  42.           including the locations used by NMI.
  43.  
  44.              This all sounds a bit like insurance doesn't it?  It
  45.           doesn't do you a bit of good unless you have a tragedy on
  46.           your hands.  Well, I like programs that you can play with,
  47.           and since you've got this neat little memory test just
  48.           sitting there in memory, why not be able to use it? NMI will
  49.           execute the memory test any time you like, as many times as
  50.           you like!
  51.  
  52.              If you're like me (a memory miser), the question in your
  53.           mind right now is... 'Just how much memory does this thing
  54.           eat?'.  The answer, approximately 1.8K including the Program
  55.           Segment Prefix and a normal size environment.  In English,
  56.           that means about 1.8K TOTAL!  Even I can afford that.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                                      Page 1
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                 NMI  Version 1.03
  71.                                   by Dennis Lee
  72.  
  73.  
  74.           PROGRAM LOADING
  75.           ---------------
  76.  
  77.              NMI /Q/I/T####
  78.                   | | |
  79.                   | | Test memory #### times.
  80.                   | |
  81.                   | |   If the number of test repetitions is 0 or
  82.                   | |   blank, then the memory test loops indefinitely
  83.                   | |   until an error is detected or you interrupt it
  84.                   | |   by pressing a key.  This option may be used to
  85.                   | |   invoke the memory test from the command line
  86.                   | |   or a batch file.  NMI need not be installed to
  87.                   | |   run the memory test.
  88.                   | |
  89.                   | Install NMI.
  90.                   |
  91.                   |   This option must be selected the first time NMI
  92.                   |   is executed if you desire to replace the current
  93.                   |   non-maskable interrupt handler.  It need not,
  94.                   |   and should not be specified again.
  95.                   |
  96.                   Quiet
  97.  
  98.                     This option is selected to suppress display of the
  99.                     program logo when NMI is installed.
  100.  
  101.  
  102.           *  If no parameters are specified, or the specified
  103.              parameters are invalid, NMI will display the program logo
  104.              followed by a summary of valid parameters.
  105.  
  106.           *  Parameters need not be separated, however, they may be
  107.              separated by one or more spaces, tabs, commas, slashes,
  108.              or semicolons.
  109.  
  110.           *  Alphabetic parameters may be upper or lower case.
  111.  
  112.           *  Parameters may be entered in any order or combination so
  113.              long as the number of test repetitions follows the 'T'
  114.              parameter and they are not separated by another
  115.              parameter.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                      Page 2
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                 NMI  Version 1.03
  137.                                   by Dennis Lee
  138.  
  139.  
  140.           +--------------------------+
  141.           |   TESTING ####K MEMORY   |
  142.           | Bank    Bit     Address  |
  143.           |  00  P76543210 0000:0000 |
  144.           |        0000 Passes       |
  145.           +--------------------------+
  146.  
  147.              When the memory test is invoked, either as the result of
  148.           a parity error, or from the command line, the above window
  149.           will be displayed in the upper left corner of the screen.
  150.           This window indicates the size of the memory being tested,
  151.           as sensed by NMI, the 64K bank currently being tested, and
  152.           the number of successful test repetitions.  In the interest
  153.           of speed, the 'Address' field is updated only for each 64K
  154.           bank in this window.  The 'Bit' field is used to indicate
  155.           failing bits and will not change unless an error is
  156.           detected.
  157.  
  158.              If the 'Esc' key is pressed, the memory test will be
  159.           terminated with parity checking enabled, and control passed
  160.           to the interrupted process. Any other key will exit the
  161.           memory test and display the termination options.
  162.  
  163.              Pass one of the memory test is always executed in a read
  164.           only mode.  This increases the possibility of detecting the
  165.           failing address.  If an error is detected in the first pass,
  166.           the address will will be written to in hopes of detecting
  167.           the failing bit.  The memory test takes approximately 35
  168.           seconds per 64K bank, longer depending upon other system
  169.           activity.
  170.  
  171.  
  172.           +--------------------------+
  173.           |   ** ERROR DETECTED **   |
  174.           | Bank    Bit     Address  |
  175.           |  00  P76543210 0000:0000 |
  176.           | Continue testing? _      |
  177.           +--------------------------+
  178.  
  179.              In the event that an error is detected during the memory
  180.           test, the above window will be displayed.  This window
  181.           indicates the failing 64K bank, exact address, and bit(s).
  182.           Depending upon the display type and video mode active at the
  183.           time of the failure, the failing bit(s) will be indicated
  184.           either by blinking, or non-display.  These bit(s) directly
  185.           correspond to the failing chip(s) in the indicated 64K bank.
  186.           In the event that the failing bit cannot be isolated, all
  187.           bits in the failing address will be indicated.
  188.  
  189.              Pressing 'Y' (or ENTER) will continue the memory test
  190.           starting with the next byte.  The number of successful
  191.           passes will be reset to zero. Pressing 'N' will exit the
  192.           memory test and display the termination options.
  193.  
  194.  
  195.  
  196.                                      Page 3
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                 NMI  Version 1.03
  203.                                   by Dennis Lee
  204.  
  205.  
  206.           +--------------------------+
  207.           | 1) Continue with parity  |
  208.           | 2) Continue w/o  parity  |
  209.           | 3) Reboot system         |
  210.           | Enter selection: _       |
  211.           +--------------------------+
  212.  
  213.              The termination option window is displayed as a result of
  214.           any key other than 'Esc' being pressed during the memory
  215.           test, or electing not to continue testing following an error
  216.           detection.  Selecting option 1 will return to the
  217.           interrupted process with parity checking enabled. Selecting
  218.           option 2 will resume the interrupted process without parity
  219.           checking.  Option 3 will reboot the system.  Pressing ENTER
  220.           will restart the memory test.
  221.  
  222.  
  223.           RETURN CODES
  224.           ------------
  225.  
  226.              If NMI is invoked from within a batch file, or by another
  227.           process, a return code may be retrieved indicating any
  228.           errors.  For batch files, the return code may be
  229.           interrogated using the 'IF ERRORLEVEL' batch subcommand.
  230.           The following table indicates possible return codes for the
  231.           current release.
  232.  
  233.                0 - Successful, no errors detected.
  234.  
  235.                1 - Error detected in parameters, program aborted.
  236.  
  237.                2 - NMI was invoked with the 'I' parameter, but is
  238.                    already installed.  Installation aborted.
  239.  
  240.                4 - Memory test already active, no memory test
  241.                    performed.  This error can occur in multi-partition
  242.                    systems if memory test is called while active in
  243.                    another partition.
  244.  
  245.              It is possible for more than one error to be returned in
  246.           the return code.  For example, a return code of 6 indicates
  247.           both errors 2 and 4 occurred.
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                                      Page 4
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                 NMI  Version 1.03
  269.                                   by Dennis Lee
  270.  
  271.  
  272.           PROGRAM DESIGN CONSIDERATIONS
  273.           -----------------------------
  274.  
  275.              Certain performance and function trade-offs are made in
  276.           the design of every program.  These trade-offs are usually
  277.           made in an attempt to provide the most function within the
  278.           constraints imposed by the operating environment in which
  279.           the program must run.  In this case, the following criteria
  280.           were taken into consideration.
  281.  
  282.           1) All resident programs must use the smallest possible
  283.              amount of memory.
  284.  
  285.           2) During the memory test, it is assumed that a memory
  286.              failure has occurred.  It is possible that the memory
  287.              failure occurred in the resident portion of DOS.  For
  288.              this reason, DOS function calls must not be used within
  289.              the resident NMI code.
  290.  
  291.                No attempt is made to save and restore the contents of
  292.                graphics screens.  This would have required additional
  293.                code and buffer space within the resident portion of
  294.                the program.  If a disk file had been used to save the
  295.                video buffer, DOS function calls would have been
  296.                required, increasing the possibility of program check
  297.                during the memory test.
  298.  
  299.           3) The memory test should first attempt to find the failure
  300.              using a read operation, so that the original failure
  301.              remains undisturbed.  If the read operation fails to
  302.              produce the error, only then should write operations be
  303.              used.  Furthermore, the failure should be located in a
  304.              single pass through memory, if possible.  This method
  305.              will provide the best odds of locating an intermittent
  306.              failure.
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                      Page 5
  329.  
  330.  
  331.